this.BX=this.BX||{};(function(t,e,i,n,a,s,l){"use strict";var r=function(){function t(){babelHelpers.classCallCheck(this,t)}babelHelpers.createClass(t,[{key:"getContent",value:function t(){return l.Tag.render("<div></div>")}},{key:"getButtonCollection",value:function t(){return[]}},{key:"init",value:function t(e){}}]);return t}();var o,c;var u=function(t){babelHelpers.inherits(e,t);function e(){babelHelpers.classCallCheck(this,e);return babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(e).apply(this,arguments))}babelHelpers.createClass(e,[{key:"getContent",value:function t(){var e=l.Tag.render(o||(o=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="license-intranet-popup__loader"></div>\n\t\t'])));var i=getComputedStyle(document.body).getPropertyValue("--ui-color-primary");var n=new a.Loader({target:e,size:133,color:i||"#2fc6f6"});n.show();return l.Tag.render(c||(c=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="license-intranet-popup__content --loader">\n\t\t\t\t','\n\t\t\t\t<div class="license-intranet-popup__loader-title">',"</div>\n\t\t\t</div>\n\t\t"])),e,l.Loc.getMessage("MAIN_COUPON_ACTIVATION_PLEASE_WAIT"))}},{key:"init",value:function t(e){e.setContent(this.getContent());e.setButtons(this.getButtonCollection())}}]);return e}(r);function p(t,e,i){v(t,e);e.set(t,i)}function v(t,e){if(e.has(t)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var b=new WeakMap;var d=new WeakMap;var h=new WeakMap;var _=new WeakMap;var T=function(){function t(e){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"POST";var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"class";babelHelpers.classCallCheck(this,t);p(this,b,{writable:true,value:"bitrix:main.coupon.activation"});p(this,d,{writable:true,value:"activate"});p(this,h,{writable:true,value:"POST"});p(this,_,{writable:true,value:"class"});babelHelpers.classPrivateFieldSet(this,d,e);babelHelpers.classPrivateFieldSet(this,h,i);babelHelpers.classPrivateFieldSet(this,_,n)}babelHelpers.createClass(t,[{key:"send",value:function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return l.ajax.runComponentAction(babelHelpers.classPrivateFieldGet(this,b),babelHelpers.classPrivateFieldGet(this,d),{mode:babelHelpers.classPrivateFieldGet(this,_),data:e,method:babelHelpers.classPrivateFieldGet(this,h)})}}]);return t}();function E(t,e,i){C(t,e);e.set(t,i)}function C(t,e){if(e.has(t)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var f=new WeakMap;var g=new WeakMap;var H=function(){function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];babelHelpers.classCallCheck(this,t);E(this,f,{writable:true,value:[]});E(this,g,{writable:true,value:void 0});this.addErrors(e)}babelHelpers.createClass(t,[{key:"addErrors",value:function t(e){babelHelpers.classPrivateFieldSet(this,f,[].concat(babelHelpers.toConsumableArray(babelHelpers.classPrivateFieldGet(this,f)),babelHelpers.toConsumableArray(e)))}},{key:"cleanErrors",value:function t(){babelHelpers.classPrivateFieldSet(this,f,[])}},{key:"hideErrors",value:function t(){if(!l.Type.isNil(babelHelpers.classPrivateFieldGet(this,g))){babelHelpers.classPrivateFieldGet(this,g).activateAutoHide()}}},{key:"show",value:function t(){if(babelHelpers.classPrivateFieldGet(this,f).length<=0){return}babelHelpers.classPrivateFieldSet(this,g,BX.UI.Notification.Center.notify({content:["<strong>".concat(l.Loc.getMessage("MAIN_COUPON_ACTIVATION_TITLE_ERROR"),"</strong><br>"),babelHelpers.classPrivateFieldGet(this,f).map((function(t){return t.message})).join("</br>")].join(""),position:"top-right",category:"menu-self-item-popup",autoHideDelay:3e5}))}}]);return t}();var A;function I(t,e){m(t,e);e.add(t)}function P(t,e,i){m(t,e);e.set(t,i)}function m(t,e){if(e.has(t)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function N(t,e,i){if(!e.has(t)){throw new TypeError("attempted to get private field on non-instance")}return i}var w=new WeakMap;var O=new WeakMap;var k=new WeakMap;var L=new WeakMap;var y=new WeakSet;var B=function(t){babelHelpers.inherits(i,t);function i(t,e){var n;babelHelpers.classCallCheck(this,i);n=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).call(this));I(babelHelpers.assertThisInitialized(n),y);P(babelHelpers.assertThisInitialized(n),w,{writable:true,value:void 0});P(babelHelpers.assertThisInitialized(n),O,{writable:true,value:void 0});P(babelHelpers.assertThisInitialized(n),k,{writable:true,value:void 0});P(babelHelpers.assertThisInitialized(n),L,{writable:true,value:void 0});babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(n),O,new H);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(n),w,new FormData);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(n),k,!l.Type.isNil(t)?t:"");babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(n),L,!l.Type.isNil(e)?e:"");return n}babelHelpers.createClass(i,[{key:"getContent",value:function t(){var e;return l.Tag.render(A||(A=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<form id="intranet-license-activate-key-form">\n\t\t\t<div class="license-intranet-popup__content --key-activate">\n\t\t\t\t<div class="license-intranet-popup__block --center">\n\t\t\t\t\t<div class="license-intranet-popup__title">','</div>\n\t\t\t\t\t<div class="license-intranet-popup__text">','</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div class="license-intranet-popup__buttons">\n\t\t\t\t\t','\n\t\t\t\t</div>\n\n\t\t\t\t<div class="license-intranet-popup__block --input-area">\n\t\t\t\t\t<div class="ui-form licence-key-form">\n\t\t\t\t\t\t<div class="ui-form-row ui-form-row-inline">\n\t\t\t\t\t\t\t\t<div class="ui-form-label">\n\t\t\t\t\t\t\t\t\t<div class="ui-ctl-label-text">','</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class="ui-form-content">\n\t\t\t\t\t\t\t\t\t<div class="ui-ctl ui-ctl-textbox ui-ctl-w100">\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\ttype="text"\n\t\t\t\t\t\t\t\t\t\t\tname="key"\n\t\t\t\t\t\t\t\t\t\t\tvalue="','"\n\t\t\t\t\t\t\t\t\t\t\tclass="ui-ctl-element licence-key-form__input"\n\t\t\t\t\t\t\t\t\t\t\tplaceholder="XXXX-XXXX-XXXX-XXXX-XX"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<a class="license-intranet-popup__help-link"\n\t\t\t\ttarget="_blank"\n\t\t\t\thref="','"\n\t\t\t>\n\t\t\t\t',"\n\t\t\t</a>\n\t\t\t</div>\n\t\t\t</form>\n\t\t"])),l.Loc.getMessage("MAIN_COUPON_ACTIVATION_TITLE_ACTIVATE_KEY"),l.Loc.getMessage("MAIN_COUPON_ACTIVATION_SUBTITLE_ACTIVATE_KEY",{"#SUPPORT_LINK#":babelHelpers.classPrivateFieldGet(this,k)}),this.renderRefreshPageBtn().render(),l.Loc.getMessage("MAIN_COUPON_ACTIVATION_LICENSE_KEY_FIELD"),(e=babelHelpers.classPrivateFieldGet(this,w).get("key"))!==null&&e!==void 0?e:"",this.getSendBtn().render(),babelHelpers.classPrivateFieldGet(this,L),l.Loc.getMessage("MAIN_COUPON_ACTIVATION_BUTTON_NEED_HELP"))}},{key:"getSendBtn",value:function t(){var i=this;return new e.Button({text:"",noCaps:false,round:true,className:"ui-btn-icon-add licence-key-form__submit-btn",size:BX.UI.Button.Size.MEDIUM,color:BX.UI.Button.Color.LIGHT_BORDER,tag:BX.UI.Button.Tag.BUTTON,onclick:function t(){var e=document.querySelector("#intranet-license-activate-key-form");var n=new FormData(e);babelHelpers.classPrivateFieldGet(i,O).hideErrors();babelHelpers.classPrivateFieldGet(i,O).cleanErrors();s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:changeContent",{source:i,target:new u});babelHelpers.classPrivateFieldSet(i,w,n);var a=new T("activate","POST","class");a.send(n).then(i.successHandler.bind(i),i.failureHandler.bind(i))}})}},{key:"init",value:function t(e){e.setContent(this.getContent());babelHelpers.classPrivateFieldGet(this,O).show()}},{key:"successHandler",value:function t(){s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:back",{source:this});document.location.href="/"}},{key:"failureHandler",value:function t(e){babelHelpers.classPrivateFieldSet(this,O,new H(e.errors));s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:back",{source:this})}},{key:"renderRefreshPageBtn",value:function t(){var i=this;return new e.Button({text:l.Loc.getMessage("MAIN_COUPON_ACTIVATION_BUTTON_REFRESH_PAGE"),noCaps:false,round:true,size:BX.UI.Button.Size.LARGE,color:BX.UI.Button.Color.SUCCESS,tag:BX.UI.Button.Tag.BUTTON,onclick:function t(){N(i,y,S).call(i)}})}}]);return i}(r);function S(){var t=new T("check");t.send().then(this.successHandler.bind(this),this.failureHandler.bind(this));s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:changeContent",{source:this,target:new u})}var M;var G=function(t){babelHelpers.inherits(e,t);function e(){babelHelpers.classCallCheck(this,e);return babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(e).apply(this,arguments))}babelHelpers.createClass(e,[{key:"getContent",value:function t(){return l.Tag.render(M||(M=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div id="intranet-license-partner-form">\n\t\t\t\t<div class="license-intranet-popup__content --partner-success">\n\t\t\t\t\t<div class="intranet-license-partner-form__success-icon"></div>\n\t\t\t\t\t<div class="license-intranet-popup__title">',"</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t"])),l.Loc.getMessage("MAIN_COUPON_ACTIVATION_TITLE_PARTNER_SUCCESS"))}},{key:"init",value:function t(e){e.setContent(this.getContent());e.setButtons(this.getButtonCollection())}}]);return e}(r);var F,U;function R(t,e,i){X(t,e);e.set(t,i)}function X(t,e){if(e.has(t)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var z=new WeakMap;var D=new WeakMap;var V=function(t){babelHelpers.inherits(i,t);function i(t){var e;babelHelpers.classCallCheck(this,i);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).call(this));R(babelHelpers.assertThisInitialized(e),z,{writable:true,value:void 0});R(babelHelpers.assertThisInitialized(e),D,{writable:true,value:void 0});babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(e),D,new H);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(e),z,new FormData);babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(e),z).set("name",l.Type.isString(t===null||t===void 0?void 0:t.NAME)?t.NAME:"");babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(e),z).set("phone",l.Type.isString(t===null||t===void 0?void 0:t.PHONE)?t.PHONE:"");babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(e),z).set("email",l.Type.isString(t===null||t===void 0?void 0:t.EMAIL)?t.EMAIL:"");return e}babelHelpers.createClass(i,[{key:"getAlert",value:function t(e){var i=new n.Alert({color:n.AlertColor.DANGER,icon:n.AlertIcon.DANGER,size:n.AlertSize.SMALL});if(e){i.setText(e)}return i.getContainer()}},{key:"getContent",value:function t(){var e,i,n;return l.Tag.render(F||(F=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<form id="main-coupon-activate-partner-form">\n\t\t\t<div id="intranet-license-partner-form">\n\t\t\t\t<div class="license-intranet-popup__content --partner">\n\t\t\t\t\t<div class="license-intranet-popup__block --center">\n\t\t\t\t\t\t<div class="license-intranet-popup__title">','</div>\n\t\t\t\t\t\t<div class="license-intranet-popup__text ui-typography-text-lg">','</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div class="license-intranet-popup__partner-form">\n\t\t\t\t\t\t<div class="license-intranet-popup__block --input-area">\n\t\t\t\t\t\t\t<div class="license-intranet-popup__input-label">','</div>\n\t\t\t\t\t\t\t<div class="ui-ctl ui-ctl-textbox ui-ctl-w100">\n\t\t\t\t\t\t\t\t<input type="text" name="name" value="','" class="ui-ctl-element">\n\t\t\t\t\t\t   </div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="license-intranet-popup__block --input-area">\n\t\t\t\t\t\t\t<div class="license-intranet-popup__input-label">','</div>\n\t\t\t\t\t\t\t<div class="ui-ctl ui-ctl-textbox ui-ctl-w100">\n\t\t\t\t\t\t\t\t<input type="text" name="phone" value="','" class="ui-ctl-element">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="license-intranet-popup__block --input-area">\n\t\t\t\t\t\t\t<div class="license-intranet-popup__input-label">','</div>\n\t\t\t\t\t\t\t<div class="ui-ctl ui-ctl-textbox ui-ctl-w100">\n\t\t\t\t\t\t\t\t<input type="text" name="email" value="','" class="ui-ctl-element">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t</form>\n\t\t'])),l.Loc.getMessage("MAIN_COUPON_ACTIVATION_TITLE_PARTNER"),l.Loc.getMessage("MAIN_COUPON_ACTIVATION_SUBTITLE_PARTNER"),l.Loc.getMessage("MAIN_COUPON_ACTIVATION_NAME_FIELD"),(e=babelHelpers.classPrivateFieldGet(this,z).get("name"))!==null&&e!==void 0?e:"",l.Loc.getMessage("MAIN_COUPON_ACTIVATION_PHONE_FIELD"),(i=babelHelpers.classPrivateFieldGet(this,z).get("phone"))!==null&&i!==void 0?i:"",l.Loc.getMessage("MAIN_COUPON_ACTIVATION_EMAIL_FIELD"),(n=babelHelpers.classPrivateFieldGet(this,z).get("email"))!==null&&n!==void 0?n:"")}},{key:"getSuccessContent",value:function t(){return l.Tag.render(U||(U=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div id="intranet-license-partner-form">\n\t\t\t\t<div class="license-intranet-popup__content --partner-success">\n\t\t\t\t\t<div class="intranet-license-partner-form__success-icon"></div>\n\t\t\t\t\t<div class="license-intranet-popup__title">',"</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t"])),l.Loc.getMessage("MAIN_COUPON_ACTIVATION_TITLE_PARTNER_SUCCESS"))}},{key:"getButtonCollection",value:function t(){var i=this;var n=new e.Button({text:l.Loc.getMessage("MAIN_COUPON_ACTIVATION_BUTTON_SEND"),noCaps:false,round:true,size:BX.UI.Button.Size.LARGE,color:BX.UI.Button.Color.SUCCESS,tag:BX.UI.Button.Tag.BUTTON,onclick:function t(){var e=document.querySelector("#main-coupon-activate-partner-form");var n=new FormData(e);babelHelpers.classPrivateFieldGet(i,D).hideErrors();babelHelpers.classPrivateFieldGet(i,D).cleanErrors();s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:changeContent",{source:i,target:new u});babelHelpers.classPrivateFieldSet(i,z,n);var a=new T("queryPartner","POST","class");a.send(n).then(i.successHandler.bind(i),i.failureHandler.bind(i))}});return[n]}},{key:"init",value:function t(e){e.setContent(this.getContent());e.setButtons(this.getButtonCollection());babelHelpers.classPrivateFieldGet(this,D).show()}},{key:"successHandler",value:function t(){s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:changeContent",{source:this,target:new G})}},{key:"failureHandler",value:function t(e){babelHelpers.classPrivateFieldSet(this,D,new H(e.errors));s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:back",{source:this})}}]);return i}(r);var x;function W(t,e){j(t,e);e.add(t)}function K(t,e,i){j(t,e);e.set(t,i)}function j(t,e){if(e.has(t)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function Y(t,e,i){if(!e.has(t)){throw new TypeError("attempted to get private field on non-instance")}return i}var q=new WeakMap;var J=new WeakMap;var Q=new WeakMap;var Z=new WeakMap;var $=new WeakSet;var tt=new WeakSet;var et=new WeakSet;var it=function(t){babelHelpers.inherits(e,t);function e(t){var i;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];babelHelpers.classCallCheck(this,e);i=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(e).call(this));W(babelHelpers.assertThisInitialized(i),et);W(babelHelpers.assertThisInitialized(i),tt);W(babelHelpers.assertThisInitialized(i),$);K(babelHelpers.assertThisInitialized(i),q,{writable:true,value:void 0});K(babelHelpers.assertThisInitialized(i),J,{writable:true,value:void 0});K(babelHelpers.assertThisInitialized(i),Q,{writable:true,value:null});K(babelHelpers.assertThisInitialized(i),Z,{writable:true,value:[]});babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),J,n);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),q,(t===null||t===void 0?void 0:t.length)>0?t:"https://www.1c-bitrix.ru/personal/order/basket.php");babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),Z,a);return i}babelHelpers.createClass(e,[{key:"getContent",value:function t(){return l.Tag.render(x||(x=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="license-intranet-popup__content --access-closed">\n\t\t\t\t<div class="license-intranet-popup__block">\n\t\t\t\t\t<div class="license-intranet-popup__title">','</div>\n\t\t\t\t\t<div class="license-intranet-popup__content-area">\n\t\t\t\t\t\t<p class="license-intranet-popup__text ui-typography-text-lg">','</p>\n\t\t\t\t\t\t<div class="license-intranet-popup__buttons">\n\t\t\t\t\t\t\t<div class="license-intranet-popup__button --renew-license">\n\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="license-intranet-popup__button">\n\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<a class="license-intranet-popup__help-link"\n\t\t\t\t\t\t\ttarget="_blank"\n\t\t\t\t\t\t\thref="','"\n\t\t\t\t\t\t>\n\t\t\t\t',"\n\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t"])),l.Loc.getMessage("MAIN_COUPON_ACTIVATION_LICENSE_OVER_TITLE"),l.Loc.getMessage("MAIN_COUPON_ACTIVATION_LICENSE_OVER_DESCRIPTION"),Y(this,tt,at).call(this).render(),Y(this,$,nt).call(this).render(),babelHelpers.classPrivateFieldGet(this,Z).DOC_LINK,l.Loc.getMessage("MAIN_COUPON_ACTIVATION_BUTTON_NEED_HELP"))}},{key:"getButtonCollection",value:function t(){return[]}},{key:"init",value:function t(i){if(l.Type.isNil(babelHelpers.classPrivateFieldGet(this,Q))){Y(this,et,st).call(this)}else if(babelHelpers.classPrivateFieldGet(this,Q)===e.stateTypes.LICENSE_ACTIVATED){document.location.href="/"}else{i.setContent(this.getContent())}}},{key:"successHandler",value:function t(i){var n=new Date(i.data.DATE_TO_SOURCE);if(!l.Type.isNil(i.data.DATE_TO_SOURCE)&&n.getTime()>(new Date).getTime()){babelHelpers.classPrivateFieldSet(this,Q,e.stateTypes.LICENSE_ACTIVATED)}else{babelHelpers.classPrivateFieldSet(this,Q,e.stateTypes.LICENSE_EXPIRED)}s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:back",{source:this})}},{key:"failureHandler",value:function t(){babelHelpers.classPrivateFieldSet(this,Q,e.stateTypes.UPDATE_SERVER_IS_UNAVAILABLE);s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:changeContent",{source:this,target:new B(babelHelpers.classPrivateFieldGet(this,Z).SUPPORT_LINK,babelHelpers.classPrivateFieldGet(this,Z).DOC_LINK)})}}]);return e}(r);function nt(){var t=this;return new e.Button({text:l.Loc.getMessage("MAIN_COUPON_ACTIVATION_BUTTON_PARTNER"),noCaps:false,round:true,size:BX.UI.Button.Size.LARGE,color:BX.UI.Button.Color.LIGHT_BORDER,tag:BX.UI.Button.Tag.BUTTON,onclick:function e(){s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:changeContent",{source:t,target:new V(babelHelpers.classPrivateFieldGet(t,Z))})}})}function at(){return new e.Button({text:l.Loc.getMessage("MAIN_COUPON_ACTIVATION_BUTTON_RENEW"),noCaps:false,round:true,link:babelHelpers.classPrivateFieldGet(this,q),size:BX.UI.Button.Size.LARGE,color:BX.UI.Button.Color.SUCCESS,tag:BX.UI.Button.Tag.LINK,props:{target:"_blank"}})}function st(){var t=new T("check");t.send().then(this.successHandler.bind(this),this.failureHandler.bind(this));s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:changeContent",{source:this,target:new u})}babelHelpers.defineProperty(it,"stateTypes",{LICENSE_EXPIRED:"license_expired",LICENSE_ACTIVATED:"license_activated",UPDATE_SERVER_IS_UNAVAILABLE:"update_server_is_unavailable"});function lt(t,e,i){rt(t,e);e.set(t,i)}function rt(t,e){if(e.has(t)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var ot=new WeakMap;var ct=new WeakMap;var ut=new WeakMap;var pt=function(){function t(e){babelHelpers.classCallCheck(this,t);lt(this,ot,{writable:true,value:void 0});lt(this,ct,{writable:true,value:void 0});lt(this,ut,{writable:true,value:[]});if(e instanceof r){babelHelpers.classPrivateFieldSet(this,ct,e)}else{babelHelpers.classPrivateFieldSet(this,ct,new it)}s.EventEmitter.subscribe(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:changeContent",this.changeHandler.bind(this));s.EventEmitter.subscribe(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:back",this.backHandler.bind(this));new T("activate","POST")}babelHelpers.createClass(t,[{key:"getPopup",value:function t(){if(babelHelpers.classPrivateFieldGet(this,ot)){return babelHelpers.classPrivateFieldGet(this,ot)}babelHelpers.classPrivateFieldSet(this,ot,new i.Popup({className:"license-intranet-popup",padding:34,width:700,closeIcon:false,borderRadius:"20px"}));return babelHelpers.classPrivateFieldGet(this,ot)}},{key:"addHistory",value:function t(e){babelHelpers.classPrivateFieldGet(this,ut).push(e)}},{key:"back",value:function t(){var e=babelHelpers.classPrivateFieldGet(this,ut).pop();if(e instanceof r){babelHelpers.classPrivateFieldSet(this,ct,e)}}},{key:"init",value:function t(){this.changeContent();this.getPopup().show()}},{key:"changeContent",value:function t(){babelHelpers.classPrivateFieldGet(this,ct).init(this.getPopup());s.EventEmitter.emit(s.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:onAfterChangeContent",{target:babelHelpers.classPrivateFieldGet(this,ct).getContent()})}},{key:"changeHandler",value:function t(e){if(e.data.target instanceof r){this.addHistory(babelHelpers.classPrivateFieldGet(this,ct));babelHelpers.classPrivateFieldSet(this,ct,e.data.target)}this.changeContent()}},{key:"backHandler",value:function t(e){if(e.data.source instanceof r){this.back()}this.changeContent()}}],[{key:"createExpiredLicensePopup",value:function e(i){var n=l.Type.isNil(i.PARTNER_ID)?0:i.PARTNER_ID;var a=l.Type.isString(i.BUY_LINK)?i.BUY_LINK:"";return new t(new it(a,n,i))}}]);return t}();t.LicensePopup=pt})(this.BX.Main=this.BX.Main||{},BX.UI,BX.Main,BX.UI,BX,BX.Event,BX);
//# sourceMappingURL=script.map.js